/*
Auhtor      : Pratibh Prakash
Company     : Fujitsu America
Created Date: 17 Sep-2009
Modified    : 
Description : Test class for "OpportunityCommitController" Controller.
 */
@isTest
private class OpportunityCommitControllerTest {

    static testMethod void testOpportunityCommit() {
       //Preparing mock data for test
        Account testAccount = new Account(Name='Test Account');
        insert testAccount;
        Opportunity testOpp = new Opportunity(Name = 'Test Opportunity', AccountId = testAccount.Id, StageName = '4 - Negotiate', IM_Booked_Date__c = Date.Today(), closedate = Date.Today()+1);
        insert testOpp;
        //Setting Opportunity in current page URL
        System.currentPageReference().getParameters().put('oppId',testOpp.Id);
        OpportunityCommitController objCommitController = new OpportunityCommitController();
        
        //Commiting Opportunity for forecast
        objCommitController.commit_uncommit_Opportunity();
        
        //Removing Opportunity from forecast
        objCommitController.commit_uncommit_Opportunity();
        
        //Calling remaining setter and getters
        objCommitController.setCustomHelpFlag(true);
        Boolean testFlag = objCommitController.getCustomHelpFlag();
        objCommitController.setSupressPopupFlag(true);
        testFlag = objCommitController.getSupressPopupFlag();
        
        
        //Updating Supress Popup flag on user.
        objCommitController.updateUser();
        
       
    }
}